import React, { useRef } from 'react';
// eslint-disable-next-line import/no-cycle
import initHelp from '../index.js';
import intl from '../../../../locale';

export default function Guide() {
  const ref = useRef(null);
  const onClickGuide = () => {
    const dom = document.querySelector('.codeUp-guide');
    if (dom) {
      dom.style.display = 'block';
      initHelp({
        showGuide: false,
      });
    }
  };
  return (
    <span ref={ref} style={{ width: '139px' }} onClick={onClickGuide}>
      {intl.get({
        id: 'code-assets.initHelp.guide.InDatabaseExploration',
        defaultMessage: '库内探索',
      })}
    </span>
  );
}
